import axios from "../utils/axios";

const findAll=async()=>{
    const data = await axios({
      url: "/group/findAll",
      method: "get",
    });
    return data
}

const addCompany = async (data1:object) => {
  const data = await axios({
    url: "/group/add",
    method: "post",
    data:data1
  });
  return data;
};

const updateCompany = async (data1:object) => {
  const data = await axios({
    url: "/group/update",
    method: "post",
    data: data1,
  });
  return data;
};

const findAllOrgan = async () => {
  const data = await axios({
    url: "/examinationOrgan/findAll",
    method: "get",
  });
  return data;
};

const findOrder = async(v:number)=>{
  const data = await axios({
    url: "/package/findPackageBysubOrganId?subOrganId="+v+"",
    method:'get'
  });
  return data
}

const deleteOrder=async(v:number)=>{
  const data = await axios({
    url: "/group/delete?id="+v+"",
  });
}

const deletesOrder = async (v: object) => {
  const data = await axios({
    url: "/group/deleteByIds",
    method:'post',
    data:v
  });
  return data
};

const searchOrder = async (v: object) => {
  const data = await axios({
    url: "/group/list",
    method: "post",
    data: v,
  });
  return data;
};

const findAllInsOrder = async (v: any) => {
  const data = await axios({
    url: "/group/findById?id=" + v + "",
    method: "get",
  });
  return data;
};

const findSubOrganOrder = async (v: any) => {
  return await axios({
    url: "/package/findPackageById?id=" + v + "",
  });
};
export {
  findAll,
  addCompany,
  findAllOrgan,
  findOrder,
  deleteOrder,
  deletesOrder,
  searchOrder,
  findAllInsOrder,
  findSubOrganOrder,
  updateCompany,
};